<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<title>[%$ESPCMS_SOFT_TITLE%]</title>
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_font_icon.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_public.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_all.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_font_icon.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_framework.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_select.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery-ui.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.cookie.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/md5.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/json.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/bootstrap.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/lngpack_cn.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_form.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_formvalidation.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_function.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_page.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_batch.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tab.js"></script>
		<script type="text/javascript">
			$(document).ready(function () {
				banpageKey();

				$('#espcms_select_botton').select_checkbox();

				loading('ajax_list');

				$('.refresh').click(function () {
					loading('ajax_list');
				});

				$('.espcms_screen').espcms_screen({formname: 'ajax_list'});

				$('#search_form').submit(function () {
					var options = {
						beforeSubmit: function (formData) {
							var queryString = $.param(formData);
							search_list(queryString, 'ajax_list');
						},
						success: function () {
							return false;
						}
					};
					$(this).ajaxSubmit(options);
					return false;
				});

				$('.select_submit').unbind('click').bind('click', function () {
					var select_id_list = $('#select_id_list').val();
					if (!select_id_list) {
						return false;
					}
					$.ajax({
						type: "get", url: '[%$link.search_key%]', data: {'select_id_list': select_id_list}, global: false,
						success: function (data) {
							parent.frames['[%$iframes_name%]'].into_input_value(data, '[%$inputname%]', true);
							parent.closeifram();
						}
					});

				});
			});

			function pageselectCallback(listurl, loadname, page_botton, per_page_num, sum_db, sum_page, now_page) {

				var select_id_list = $('#select_id_list').val();
				if (select_id_list) {

					var select_id_list_array = select_id_list.split(',');

					var select_id_name_array = new Array();
					for (var i = 0; i <= select_id_list_array.length; i++) {
						if (select_id_list_array[i]) {

							select_id_name_array.push('#select_id_' + select_id_list_array[i]);
						}
					}

					select_id_list = select_id_name_array.join(',');
				}

				$("#now_page").val(now_page);

				var sort_key = $('#sort_key').val();
				var sort_rank = $('#sort_rank').val();

				var limit = per_page_num * now_page;
				$.ajax({
					type: "get", url: listurl, data: {'limit': limit, 'per_page_num': per_page_num, 'sort_key': sort_key, 'sort_rank': sort_rank}, global: false,
					beforeSend: function () {
						$('#loadingtable').show();
					},
					success: function (data) {
						$('#loadingtable').hide();
						$(loadname).empty().append(data);

						$('input[type=checkbox],input[type=radio]').espcms_checkbox();
						$('.sort_field').fieldsort();

						if (select_id_list) {
							$(select_id_list).espcms_checkbox('check');
						}

						$('input').on('ifChanged', function (event) {


							if (this.checked) {
								select_id_update('#select_id_list', this.value, 'add');
							} else {
								select_id_update('#select_id_list', this.value, 'del');
							}
							update_select();
						});
					}
				});
			}

			function update_select() {
				var select_id_list = $('#select_id_list').val();
				if (select_id_list && $('.select_submit').hasClass('displaynone')) {
					$('.select_submit').removeClass('displaynone');
				}
				if (!select_id_list && !$('.select_submit').hasClass('displaynone')) {
					$('.select_submit').addClass('displaynone');
				}
			}
		</script>
	</head>

	<body class="espcms_style_all">
		<div class="main">
			<div class="espcms_center_content_window vt">

				<div class="panel_list_button kill_copy">
					<div class="row">
						<div class="col-sm-9">
							<div class="btn-group" role="group" id="espcms_select_botton"></div>
							<div class="btn-group espcms_menu_screen">
								<button type="button" class="btn btn-treegree btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><span class="espcms_icon_fa espcms_icon_fa-filter" aria-hidden="true"></span> [%pack:botton_pack-espcms_botton_screen%] <span class="caret"></span></button>
								<ul class="dropdown-menu" id="bat_botton">
									[%list name=article_model%]
								</ul>
							</div>
							<button class="btn btn-lightgray btn-sm refresh"><span class="espcms_icon_fa espcms_icon_fa-refresh" aria-hidden="true"></span>[%pack:botton_pack-espcms_botton_refresh%]</button>
							<button class="btn btn-green btn-sm select_submit displaynone"><span class="espcms_icon_fa espcms_icon_fa-check" aria-hidden="true"></span>[%pack:botton_pack-espcms_botton_select_ok%]</button>
						</div>
						<div class="col-sm-3">
							<form role="search" name="search_form" id="search_form">
								<input type="hidden" name="issearch" value="1"/>
								<div class="input-group input-group-sm">
									<input type="text" name="search_key" id="search_key" class="form-control" placeholder="[%pack:public_pack-espcms_lable_input_search_keyword%]"/>
									<span class="input-group-btn"><button class="btn btn-lightgray" type="submit">[%pack:botton_pack-espcms_botton_search%]</button></span>
								</div>
							</form>
						</div>
					</div>
				</div>
				<div class="panel">
					<form name="ajax_list" method="post" id="ajax_list">
						<input type="hidden" name="listurl" id="listurl" value="[%$link.list%]"/>
						<input type="hidden" name="loadname" id="loadname" value="#loadingstr"/>
						<input type="hidden" name="page_botton" id="page_botton" value="#page_botton_list"/>
						<input type="hidden" name="sum_select_show" id="sum_select_show" value="0"/>

						<input type="hidden" name="per_page_num" id="per_page_num" value="10"/>

						<input type="hidden" name="sum_db" id="sum_db" value="[%$page_db.sum_db%]"/>

						<input type="hidden" name="sum_page" id="sum_page" value="[%$page_db.sum_page%]"/>

						<input type="hidden" name="now_page" id="now_page" value="[%$page_db.now_page%]"/>
						<input type="hidden" name="sort_key" id="sort_key" value="kid"/>

						<input type="hidden" name="sort_rank" id="sort_rank" value="DESC"/>

						<input type="hidden" name="select_id_list" id="select_id_list"/>
						<input type="hidden" name="select_value_list" id="select_value_list"/>
						<div id="loadingtable" class="displaynone"><div class="loading_pic"></div></div>
						<div class="panel-body p0" id="loadingstr"></div>

						<div class="panel-menu kill_copy panel_page_button">
							<div class="right">
								<div class="btn-toolbar" role="toolbar" id="page_botton_list"></div>
							</div>
						</div>
					</form>
				</div>

			</div>
		</div>
	</body>
</html>
